import request from '@/utils/request'

let group = '/workflow'

export function getAllList() {
  return request({
    url: group,
    method: 'get',
  })
}
export function getMainPaths(flowid) {
  return request({
    url: group + '/path/' + flowid,
    method: 'get',
  })
}

export function del(id) {
  return request({
    url: group + '/' + id,
    method: 'delete',
  })
}

export function enable(id) {
  return request({
    url: group + '/enable/' + id,
    method: 'put',
  })
}

export function add(data) {
  return request({
    url: group,
    method: 'post',
    data: data,
  })
}

export function update(id, data) {
  return request({
    url: group + '/' + id,
    method: 'put',
    data: data,
  })
}
export function get(id) {
  return request({
    url: group + '/' + id,
    method: 'get',
  })
}
export function getStartState(id) {
  return request({
    url: group + '/' + id + '/startstate',
    method: 'get',
  })
}
export function getUserDeptListOptions(uid) {
  return request({
    url: group + '/UserDeptListOptions/' + uid,
    method: 'get',
  })
}
